When a user is looking through a page, if a distance between the user and a display device of the electronic device is too far or too near, sizes of characters on the page are too small or too big for the user. The user has to zoom in the page or zoom out the page manually until the user is satisfied with the adjusted sizes of characters.